Calendar variables
If you want your agent to be able to properly understand words like “tomorrow” or “Monday next week” it is not enough to include information about current date and time in your prompt. Even if LLM knows current date it has very vague idea about calendar – and will typically hallucinate on the relevant questions.
To mitigate this problem you may include the calendar variable to include detailed calendar information in your prompt.
Example
Calendar information:
{calendar}
By default, {calendar} variable provides information about past, current, and the next four weeks. If you need more information, use the {calendar(N)} syntax that provides information for N next weeks.
Expanded result
When the prompt is sent to the LLM, the {calendar} variable is replaced with a weekly breakdown similar to the following (assuming today is Thursday, June 25, 2026):
[
Today is Thursday, June 25, 2026
Previous week is:
- Monday, June 15, 2026
- Tuesday, June 16, 2026
- Wednesday, June 17, 2026
- Thursday, June 18, 2026
- Friday, June 19, 2026
- Saturday, June 20, 2026
- Sunday, June 21, 2026
This week is:
- Monday, June 22, 2026
- Tuesday, June 23, 2026
- Wednesday, June 24, 2026
- Thursday, June 25, 2026
- Friday, June 26, 2026
- Saturday, June 27, 2026
- Sunday, June 28, 2026
Next week is:
- Monday, June 29, 2026
- Tuesday, June 30, 2026
- Wednesday, July 1, 2026
- Thursday, July 2, 2026
- Friday, July 3, 2026
- Saturday, July 4, 2026
- Sunday, July 5, 2026
Week after that (2 weeks from now):
- Monday, July 6, 2026
- Tuesday, July 7, 2026
- Wednesday, July 8, 2026
- Thursday, July 9, 2026
- Friday, July 10, 2026
- Saturday, July 11, 2026
- Sunday, July 12, 2026
Week after that (3 weeks from now):
- Monday, July 13, 2026
- Tuesday, July 14, 2026
- Wednesday, July 15, 2026
- Thursday, July 16, 2026
- Friday, July 17, 2026
- Saturday, July 18, 2026
- Sunday, July 19, 2026
]
The day on which the weeks are based, as well as the timezone used to determine "today", is taken from the timezone variable (UTC if not set).